/**
 */
package org.xtext.ic.dsl.icDsl.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.xtext.ic.dsl.icDsl.DataBase;
import org.xtext.ic.dsl.icDsl.IcDslPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Data Base</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.ic.dsl.icDsl.impl.DataBaseImpl#isMysql <em>Mysql</em>}</li>
 *   <li>{@link org.xtext.ic.dsl.icDsl.impl.DataBaseImpl#isSqlserver <em>Sqlserver</em>}</li>
 *   <li>{@link org.xtext.ic.dsl.icDsl.impl.DataBaseImpl#isOracle <em>Oracle</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DataBaseImpl extends MinimalEObjectImpl.Container implements DataBase
{
  /**
   * The default value of the '{@link #isMysql() <em>Mysql</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isMysql()
   * @generated
   * @ordered
   */
  protected static final boolean MYSQL_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isMysql() <em>Mysql</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isMysql()
   * @generated
   * @ordered
   */
  protected boolean mysql = MYSQL_EDEFAULT;

  /**
   * The default value of the '{@link #isSqlserver() <em>Sqlserver</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isSqlserver()
   * @generated
   * @ordered
   */
  protected static final boolean SQLSERVER_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isSqlserver() <em>Sqlserver</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isSqlserver()
   * @generated
   * @ordered
   */
  protected boolean sqlserver = SQLSERVER_EDEFAULT;

  /**
   * The default value of the '{@link #isOracle() <em>Oracle</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isOracle()
   * @generated
   * @ordered
   */
  protected static final boolean ORACLE_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isOracle() <em>Oracle</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isOracle()
   * @generated
   * @ordered
   */
  protected boolean oracle = ORACLE_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected DataBaseImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return IcDslPackage.Literals.DATA_BASE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isMysql()
  {
    return mysql;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setMysql(boolean newMysql)
  {
    boolean oldMysql = mysql;
    mysql = newMysql;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, IcDslPackage.DATA_BASE__MYSQL, oldMysql, mysql));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isSqlserver()
  {
    return sqlserver;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSqlserver(boolean newSqlserver)
  {
    boolean oldSqlserver = sqlserver;
    sqlserver = newSqlserver;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, IcDslPackage.DATA_BASE__SQLSERVER, oldSqlserver, sqlserver));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isOracle()
  {
    return oracle;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setOracle(boolean newOracle)
  {
    boolean oldOracle = oracle;
    oracle = newOracle;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, IcDslPackage.DATA_BASE__ORACLE, oldOracle, oracle));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case IcDslPackage.DATA_BASE__MYSQL:
        return isMysql();
      case IcDslPackage.DATA_BASE__SQLSERVER:
        return isSqlserver();
      case IcDslPackage.DATA_BASE__ORACLE:
        return isOracle();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case IcDslPackage.DATA_BASE__MYSQL:
        setMysql((Boolean)newValue);
        return;
      case IcDslPackage.DATA_BASE__SQLSERVER:
        setSqlserver((Boolean)newValue);
        return;
      case IcDslPackage.DATA_BASE__ORACLE:
        setOracle((Boolean)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case IcDslPackage.DATA_BASE__MYSQL:
        setMysql(MYSQL_EDEFAULT);
        return;
      case IcDslPackage.DATA_BASE__SQLSERVER:
        setSqlserver(SQLSERVER_EDEFAULT);
        return;
      case IcDslPackage.DATA_BASE__ORACLE:
        setOracle(ORACLE_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case IcDslPackage.DATA_BASE__MYSQL:
        return mysql != MYSQL_EDEFAULT;
      case IcDslPackage.DATA_BASE__SQLSERVER:
        return sqlserver != SQLSERVER_EDEFAULT;
      case IcDslPackage.DATA_BASE__ORACLE:
        return oracle != ORACLE_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (mysql: ");
    result.append(mysql);
    result.append(", sqlserver: ");
    result.append(sqlserver);
    result.append(", oracle: ");
    result.append(oracle);
    result.append(')');
    return result.toString();
  }

} //DataBaseImpl
